package com.yun.algorithmproblem.leetcode;

public class Leetcode1863 {

	int ans = 0;
	int[] nums;

	public int subsetXORSum(int[] nums) {
		this.nums = nums;
		dfs(0, 0);
		return ans;
	}

	private void dfs(int start, int curr) {
		if (start >= nums.length) {
			ans += curr;
			return;
		}
		//选
		dfs(start + 1, curr ^ nums[start]);
		//不选
		dfs(start + 1, curr);
	}
}
